package controllers

import config.Global
import javax.inject._
import play.api.libs.json.Json
import play.api.mvc._
import utils.TableUtils

@Singleton
class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {

  def indexPage = Action {
    Ok(views.html.home.indexPage2())
  }

  def contactPage = Action {
    Ok(views.html.contact.contactPage())
  }

  def downloadPage = Action{
    Ok(views.html.download.downloadPage())
  }

  def blankPage(title: String) = Action {
    Ok(views.html.blank.blankPage(title))
  }

  def statPage = Action {
    Ok(views.html.statistics.statisticPage2())
  }

  def getHypgeomdist = Action{
    Ok(Json.toJson(TableUtils.hypgeomdist))
  }

  def helpPage = Action{
    Ok(views.html.help.helpPage())
  }

  def qtlData = Action{
    Ok(Json.obj("data" -> TableUtils.qtlStat,"header" -> TableUtils.qtlHeader))
  }





}
